# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=aircrack-ng
pkgver=1.6
_pkgver=${pkgver/_/-}
pkgrel=0
pkgdesc="Key cracker for the 802.11 WEP and WPA-PSK protocols"
url="http://www.aircrack-ng.org"
arch="all !s390x !mips !mips64" # tests fails on big-endian
license="GPL-2.0-or-later"
depends="ethtool wireless-tools iw sqlite grep"
makedepends="autoconf automake libnl3-dev libpcap-dev openssl-dev libtool
	linux-headers pcre-dev python3-dev sqlite-dev zlib-dev"
checkdepends="coreutils"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/aircrack-ng/aircrack-ng/archive/$pkgver.tar.gz
	make-check-fix.patch"
builddir="$srcdir"/$pkgname-$_pkgver

prepare() {
	default_prepare
	cd "$builddir"
	autoreconf -fiv
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-experimental
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="14a74feca23b802e4f67a3e3fceea315302b4f272b32215044fc98ea4d190b5782c5be34ccf601d8b6579e1440b62749d42a967dac8794c7b4f48c715dbeba43  aircrack-ng-1.6.tar.gz
f57a8a78f164e06176600d8637e00350747aae21e91f261de9639255ea83594782c9d94474e901dac71c68e916a8951a22fc9ac2607eec65cb23954fe3656c07  make-check-fix.patch"
